package com.lb.lb_ad_demo;

import android.app.Activity;
import android.content.Context;

public class LBAD_Config {
    // APPID
    public static final String APPID = "a61234e1cb6a76";
    //渠道
    public static final String CHANNEL = "spx_XH";
    //开屏
    public static final String SP_ID = "b61234e97ae5b8";
    //激励视频
    public static final String REWARDVIDEO_ID = "b61234e96d42dc";
    //插屏
    public static final String INNER_ID = "b61234e9745c95";
    //信息流
    public static final String NATIVE_ID = "b61234e9652b8b";
    //信息流2
    public static final String NATIVE_ID2 = "b612628cad0087";
    //全屏视频
    public static final String FULLVIDEO_ID = "b61234e981742d";
    //横幅banner
    public static final String BANNER_ID = "b6126335274bc3";

    private static int nativeAD1Width;//原生广告1宽度
    private static int nativeAD1Height;//原生广告1高度
    private static  int nativeAD2Width;//原生广告2宽度
    private static int nativeAD2Height;//原生广告2高度

    private static int bannerHeight;


    public static int getNativeAD1Width(Activity activity){
        if(nativeAD1Width == 0){
            nativeAD1Width =  activity.getResources().getDisplayMetrics().widthPixels;

        }
        return nativeAD1Width;
    }

    public static int getNativeAD1Height(Activity activity){
        if(nativeAD1Height == 0){
            nativeAD1Height =  dip2px(activity,256);
        }
        return nativeAD1Height;
    }

    public static int getNativeAD2Width(Activity activity){
        if(nativeAD2Width == 0){
            nativeAD2Width =  activity.getResources().getDisplayMetrics().widthPixels*2/3;

        }
        return nativeAD2Width;
    }

    public static int getNativeAD2Height(Activity activity){
        if(nativeAD2Height == 0){
            nativeAD2Height =  getNativeAD2Width(activity)*16/9;

        }
        return nativeAD2Height;
    }


    public static int getBannerHeight(Activity activity){
        if(bannerHeight == 0){
            bannerHeight = dip2px(activity,70);
        }
        return  bannerHeight;
    }

    public static int dip2px(Context activity, float dipValue) {
        float scale = activity.getResources().getDisplayMetrics().density;
        return (int) (dipValue * scale + 0.5f);
    }

}
